# coding=utf-8
"""
Author: Mr.夏末
@Function: 功能名称
"""
<<<<<<< HEAD
from common.Logger import logger

=======
>>>>>>> bbe5575b39a883d3ba625b099ff1bdaa9564f25f
# 关联装饰器
def relations(func):
    def wrapper(*args,**kwargs):
        # 把元组参数转化为列表
        args = list(args)
        # 因为是面向对象，所有第一个参数都是self，相当于web
        self = args[0]
        for key in self.relation_dict:
            # 遍历所有的键
            for i in range(1,len(args)):
                args[i] = args[i].replace('{' + str(key) + '}', str(self.relation_dict.get(key)))
<<<<<<< HEAD
        logger.info(args[1:])
        # 调用关键字
        res = func(*args,**kwargs)
        return res
    return wrapper
=======
        print(args[1:])
        # 调用关键字
        res = func(*args,**kwargs)
        return res
    return wrapper
>>>>>>> bbe5575b39a883d3ba625b099ff1bdaa9564f25f
